
#include "buff.h"


Buff::Buff(const int& dur, const std::string& ID) :
    cancelID(ID), duration(dur)
{
    type[Attack] = 0;
    type[Defense] = 0;
    type[Speed] = 0;
}

Buff::Buff(const Buff& b)
{
    cancelID = b.cancelID;
    duration = b.duration;
    type = b.type;
}

void Buff::set(Bufftype b, const int& str)
{
    type[b] = str;
}

void Buff::tick()
{
    // reduces duration if needed, when duration == 0 the buff expires and is removed
    if (duration > 0)
    {
        --duration;
    }
}
